<template>
    <view class="richText">
        <view class="richText-title">{{ item.title }}</view>
        <view class="richText-tims">{{ item.updatetime }}</view>
        <view class="richText-content" v-html="replaceWhite(item.content)"></view>
    </view>
</template>

<script>
import { getHomeBannerDetail } from "@/api/api.js"
import { replaceWhite } from "@/util/util.js"
export default {
    data() {
        return {
            item: {}
        }
    },
    onLoad(options) {
        if (options.id) {
            this.bannerDdetail(options.id)
        }
    },
    methods: {
        replaceWhite,
        bannerDdetail(id) {
            getHomeBannerDetail({ banner_id: id }).then(res => {
                if (res.code == 1) {
                    console.log(res)
                    this.item = res.data
                    uni.setNavigationBarTitle({ title: res.data.title })
                }
            })
        },


    },
}
</script>

<style scoped>
.richText {
    padding: 30upx;
}

.richText-title {
    font-size: 40upx;
    color: #333333;
    font-weight: bold;
    margin-bottom: 10upx;
}

.richText-tims {
    font-size: 24upx;
    color: #999999;
    margin-bottom: 30upx;
    text-align: right;
}

.richText-content {
    width: 100%;
    overflow: auto;
}
</style>